namespace CONC_NO_LOCK {
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

pthread_t tid[2];

void* trythis(void* arg)
{
	pthread_mutex_t lock;
	if (pthread_mutex_init(&lock, NULL) != 0) {
		printf("\n mutex init has failed\n");
		return NULL;
	}

	pthread_mutex_unlock(&lock);

	return NULL;
}

int main(void)
{
	int i = 0;
	int error;

	error = pthread_create(&(tid[i]),
		NULL,
		&trythis, NULL);
	if (error != 0)
		printf("\nThread can't be created :[%s]",
			strerror(error));

	pthread_join(tid[0], NULL);

	return 0;
}


#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

pthread_t tid[2];

void* trythis(void* arg)
{
	pthread_mutex_t lock;
	if (pthread_mutex_init(&lock, NULL) != 0) {
		printf("\n mutex init has failed\n");
		return NULL;
	}

	pthread_mutex_lock(&lock);
	pthread_mutex_unlock(&lock);

	return NULL;
}

int main(void)
{
	int i = 0;
	int error;

	error = pthread_create(&(tid[i]),
		NULL,
		&trythis, NULL);
	if (error != 0)
		printf("\nThread can't be created :[%s]",
			strerror(error));

	pthread_join(tid[0], NULL);

	return 0;
}
}}